package gui;
// Screen.java
// Represents the screen of the ATM

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;

public class Screen extends JFrame{

	public static final String WELCOME = "welcome";
	public static final String ADMINMENU = "adminmenu";

	private JPanel contentPane;
	private Welcome welcome;
	private AdminMenu adminmenu;
	private UserMenu usermenu;
	private CardLayout cardlay;
	
	public Screen(){
		setDefaultCloseOperation(EXIT_ON_CLOSE);
		setTitle("Gruppe 7 - ATM Case 2013");
		setBounds(0, 0, 500, 350);
		setLocation(300,200);
		contentPane = new JPanel();
		setContentPane(contentPane);
		contentPane.setLayout(new CardLayout());
		
		Welcome welcome = new Welcome();
		contentPane.add(welcome,"welcome");
		
		AdminMenu adminmenu = new AdminMenu();
		contentPane.add(adminmenu, "adminmenu");
		
		UserMenu usermenu = new UserMenu();
		contentPane.add(usermenu, "usermenu");
		
		cardlay = (CardLayout) getContentPane().getLayout();
	}
	
	public Welcome getWelcome() {
		return welcome;
	}
	
	public AdminMenu getAdminMenu(){
		return adminmenu;
	}
	
	public UserMenu getUserMenu(){
		return usermenu;
	}
	
	public void show(String card) {
		cardlay.show(this.getContentPane(), card);
	}
	
} // end class Screen